<?
//Import Classes
	require_once('classes/session.php');
	require_once('classes/sql_wtc.php');
	require_once('classes/functions.php');
	require_once('classes/country.php');
	
	$myDB = new MySQL_class();
	$myDB->Create();

//Get Parameters
	if (!isset($_SESSION['view'])||!$_SESSION['view'][0][0]) {
		@mysql_close();
		header ("Location: empty_cart.php");
		exit();
	}

	if (isset($_SESSION['user'])&&$_SESSION['user'][0])
		$user=$_SESSION['user'];
	else {
		@mysql_close();
		header("Location: sign_in.php");
		exit();
	}

	if (isset($_SESSION['order'])&&$_SESSION['order']['recipient_email'])
		$order=$_SESSION['order'];
	else {
		@mysql_close();
		header("Location: check_out_delivery_details.php");
		exit();
	}

//Functions

	$menuhtml		= buildMenu($cat_lev,$category,$cat_par,'product.php');
	$carthtml		= checkCart($_SESSION['view'],$order['shipping_region'],$order['shipping_carrier']);

?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>Jonesky eShopping</title>

<link href="css/main.css" rel="stylesheet" type="text/css">

</head>

<body>
<table width="770" align="center" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="85" align="center" valign="top">
	  <table width="100%" height="84"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="205" rowspan="3" align="center" valign="middle" background="images/index_LOGO_t1-1.gif">&nbsp;</td>
          <td width="1" rowspan="3"></td>
          <td height="57" align="right" background="images/index_CH_t1-2-1.gif"><table width="430" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="425" height="34" align="right" background="images/index_CH_t1-2-1-2.gif"><a href="../Jonesky_CH/check_out_order_details.php"><img src="images/jonesky_chinese.gif" border="0"></a></td>
			  <td width="5"></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td height="1"></td>
        </tr>
        <tr>
          <td height="26" align="right" background="images/index_SVC_t1-2-2.gif"><table width="254" height="18" border="0" cellpadding="0" cellspacing="0">
            <tr align="left" valign="middle">
              <td width="109"><a class=s3 href="shipping_charge_list.php">- Shipping Charge </a></td>
              <td width="70"><a class=s3 href="view_cart.php">- View Cart </a></td>
              <td width="75"><a class=s3 href="check_out_delivery_details.php">- Check Out</a> </td>
            </tr>
          </table></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td height="111" bgcolor="#FF0000"><img src="images/<?=randomBanner()?>" width="770" height="111"></td>
  </tr>
    <tr>
    <td height="1"></td>
  </tr>
  <tr>
    <td height="475" valign="top"><table width="100%" height="475"  border="0" cellpadding="0" cellspacing="0" class="mytd">
      <tr>
        <td height="31"><table width="100%" height="31"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="710" background="images/red_navigate.gif"><table width="100%" height="31"  border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="43" align="center"><a class=s3 href="index_eng.php">Home</a></td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="59" align="center"><a class=s3 href="about_us.php">About us </a></td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="86" align="center"><a class=s3 href="new_products.php">New Products </a></td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="68" align="center"><a class=s3 href="promotion.php">Promotion</a></td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="33" align="center"><a class=s3 href="faq.php">FAQ</a></td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="130" align="center"><a class=s3 href="terms_and_condition.php">Terms and Conditions</a></td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="83" align="center"><a class=s3 href="return_policy.php">Return Policy </a></td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="93" align="center"><a class=s3 href="delivery_policy.php">Delivery Policy</a> </td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="71" align="center"><a class=s3 href="contact_us.php">Contact us </a></td>
                <td width="1"><img src="images/whiteLine.gif"></td>
                <td width="35" align="center"><a class=s3 href="news.php">News</a></td>
              </tr>
            </table></td>
            <td><img src="images/red_navigate_right.gif" width="36" height="31"></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td height="381"><table width="100%" height="100%"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="4"></td>
            <td width="192" valign="top">
			<table border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="2" bgcolor="#FFFFFF"></td>
                <td width="184" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td height="2" bgcolor="#FFFFFF"></td>
                  </tr>
                  <tr>
                    <td height="28"><img src="images/products0.gif" width="184" height="28"></td>
                  </tr>
                  <tr>
                    <td height="2" bgcolor="#FFFFFF"></td>
                  </tr>
                  <tr>
                    <td height="80" background="images/products3.jpg">
                      <form name="searchbox" action="product_search_result.php" method="post"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td height="20">&nbsp;&nbsp;&nbsp;&nbsp;<a class=s2>Keywords</a></td>
                        </tr>
                        <tr>
                          <td>&nbsp;&nbsp;&nbsp;<input name="search" type="text" class="text" id="search" size="20"></td>
                        </tr>
                        <tr>
                          <td height="28">&nbsp;&nbsp;&nbsp;<input name="submit" type="submit" class="button" id="submit" onClick="MM_validateForm('search','','R');return document.MM_returnValue" value="Search"></td>
                        </tr>
                      </table></form>
</td>
                  </tr>
				<?=$menuhtml?>
                </table></td>
                <td width="6" valign="top" background="images/index_SVC_t1-2-2.jpg">&nbsp;</td>
              </tr>
              <tr>
                <td width="2" bgcolor="#FFFFFF"></td>
                <td height="12" background="images/Pro_Search_bottom.gif">&nbsp;</td>
                <td width="6"><img src="images/Pro_Search_circle.gif" width="6" height="12"></td>
              </tr>
            </table>
			</td>
            <td width="574" valign="top"><div style="padding:10px 2px;" align="center">
        <img src="images/procedure4.gif" width="562" height="50"><br>
        <br>

                    <table width="540" border="0" align="center" cellpadding="2" cellspacing="0">
                      <tr> 
                        <td height="20" colspan="5"> <table width="560" height="23"  border="0" align="center" cellpadding="0" cellspacing="0" background="images/table_line.jpg">
                            <tr> 
                              <td width="84" class="s4">&nbsp; Item</td>
                              <td width="277" class="s4">Description</td>
                              <td width="35" class="s4"><div align="center">Qty</div></td>
                              <td width="77" align="center" class="s4"><div align="right">Unit 
                                  Price </div></td>
                              <td width="87" align="center" class="s4"><div align="center">Amount</div></td>
                            </tr>
                          </table></td>
                      </tr>
					<?=$carthtml?>
                    </table>
      
      <p>&nbsp;</p>
	  
                    <table width="540" border="0" align="center" cellpadding="3" cellspacing="0">
                      <tr> 
                        <td colspan="2" class='s10'>Recipient Details</td>
                      </tr>
                      <tr> 
                        <td height="10" class='s4'></td>
                        <td height="10"></td>
                      </tr>
                      <tr> 
                        <td width="25%" height="20" class='s4'>Title:<br></td>
                        <td width="75%"><?=$order['recipient_title']?></td>
                      </tr>
                      <tr> 
                        <td class='s4'>Recipient Name: </td>
                        <td><?=$order['recipient_name']?></td>
                      </tr>
                      <tr> 
                        <td class='s4'>Contact Email: </td>
                        <td><?=htmlspecialchars($order['recipient_email'])?></td>
                      </tr>
                      <tr> 
                        <td height="10"></td>
                        <td height="10"></td>
                      </tr>
                      <tr> 
                        <td colspan="2" class='s10'>Delivery Method</td>
                      </tr>
                      <tr> 
                        <td height="10" class='s4'></td>
                        <td height="10"></td>
                      </tr>
                      <tr> 
                        <td class='s4'>Delivery Region:</td>
                        <td><?=$order['shipping_region']?></td>
                      </tr>
                      <tr> 
                        <td class='s4'>Delivery Method:</td>
                        <td><?=$order['shipping_carrier']?></td>
                      </tr>
                      <tr> 
                        <td height="10"></td>
                        <td height="10"></td>
                      </tr>
                      <tr> 
                        <td colspan="2" class='s10'>Member Registration Address</td>
                      </tr>
                      <tr> 
                        <td height="10" class='s4'></td>
                        <td height="10"></td>
                      </tr>
                      <tr> 
                        <td class='s4'> Registration address :</td>
                        <td><?=nl2br($order['recipient_address'])?></td>
                      </tr>
                      <tr> 
                        <td class='s4'>Country:</td>
                        <td><?=htmlspecialchars($order['recipient_country'])?></td>
                      </tr>
                      <tr> 
                        <td class='s4'>*Zip Code:</td>
                        <td><?=htmlspecialchars($order['recipient_zip'])?></td>
                      </tr>
                      <tr> 
                        <td class='s4'>Contact Phone:</td>
                        <td><?=htmlspecialchars($order['recipient_tel1'])?> (*country code) </td>
                      </tr>
                      <tr> 
                        <td>&nbsp;</td>
                        <td><?=htmlspecialchars($order['recipient_tel2'])?> (*area code)</td>
                      </tr>
                      <tr> 
                        <td>&nbsp;</td>
                        <td><?=htmlspecialchars($order['recipient_tel3'])?> (telephone)</td>
                      </tr>
                      <tr> 
                        <td height="10"></td>
                        <td height="10"></td>
                      </tr>
                      <tr> 
                        <td colspan="2" class='s10'> Delivery Address </td>
                      </tr>
                      <tr>
                        <td height="10" class='s4'></td>
                        <td height="10"></td>
                      </tr>
                      <tr> 
                        <td class='s4'> Delivery address :</td>
                        <td><?=nl2br($order['billing_address'])?></td>
                      </tr>
                      <tr> 
                        <td class='s4'>Country:</td>
                        <td><?=htmlspecialchars($order['billing_country'])?></td>
                      </tr>
                      <tr> 
                        <td class='s4'>*Zip Code:</td>
                        <td><?=htmlspecialchars($order['billing_zip'])?></td>
                      </tr>
                      <tr> 
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                      </tr>
                      <tr> 
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                      </tr>
                    </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr> 
          <td width="100%">
		  <?
	$cid=$order['shipping_region'];
	$sql="select id from med_shipping where region = '$cid' ";
	$myDB->Query($sql);
	$rec=mysql_fetch_object($myDB->result);
	//echo $rec->id;

		  ?>
		  &nbsp;&nbsp;&nbsp;&nbsp;<a href="check_out_delivery_details.php"><img src="images/myo_up.gif" border="0"></a> 
            &nbsp;&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;&nbsp;<a href="check_out_payment_details.php?t=<?=$rec->id?>"><img src="images/corder_up.gif" border="0"></a> 
          </td>
        </tr>
      </table>
</div>      </td>
          </tr>
        </table></td>
      </tr>
      <tr>
          <td height="80" align="center" valign="bottom" bgcolor="#FFFFFF"><span class="s1">Copyright 
            &copy; 2004, All Rights Reserved by Jonesky Limited. <br>
            &nbsp;&nbsp; </span></td>
      </tr>

    </table></td>
  </tr>

</table>
</body>
</html>
<?
		@mysql_close();
?>